package yf.mall.dao;

import yf.mall.entity.LotteryRecordEntity;
import yf.mall.vo.LotteryRecordVo;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import java.util.List;
/**
 * 抽奖记录Dao
 *
 * 
 * 
 * @date Thu Aug 20 11:07:03 CST 2020
 */
@Mapper
public interface LotteryRecordDao extends BaseDao<LotteryRecordEntity> {

    List<LotteryRecordVo> findVo(LotteryRecordVo vo);

    LotteryRecordVo getVo(Long id);


    Integer totalActIdAndGoodsId(Long actId, Long goodsId);

    List<LotteryRecordEntity> findByUserId(Long userId, Long actId);

    Integer totalByUserIdTodayNumber(Long userId, Long actId, String time);

    LotteryRecordEntity findByUserIdAndLotteryCode(long userId, String lotteryCode);


    List<LotteryRecordEntity> findByUserIdAndBandGoodsIdAndStatus(Long userId, Long bandGoodsId, int status);

    List<LotteryRecordEntity> findByOrderNo(String orderNo);

    void deleteByOrderNo(String orderNo);


    List<LotteryRecordEntity> findByActId(Long id);

    Integer findByActIdAndGoodsId(Long actId, Long goodsId);

    List<LotteryRecordEntity> findByUserIdAndActIdAndIsLottery(Long userId, Long actId, int isLottery);

    List<LotteryRecordEntity> findByUserIdIsLottery(Long userId, int isLottery);

    List<LotteryRecordEntity> findByUserIdAndActIdAndIsLotteryAndStatus(Long actId);
}
